﻿using MvcApplication.Entity;
using System.Collections.Generic;
using System.Linq;

namespace MvcApplication.Data
{
    public static class IQueryExtend
    {
        public static List<T> Page<T>(this IQueryable<T> query, Pager pager)
        {
            return query.Skip((pager.PageIndex - 1) * pager.PageSize).Take(pager.PageSize).ToList();
        }
    }
}
